package zjut.raymond.witdemo.pojo;

import androidx.annotation.Nullable;

import java.util.Date;

/**
 * Reference point
 *
 * @author Raymond
 * @Description 参考点
 * @date 2021 /6/5-16:38
 */

public class ReferencePoint {
    /**
     * Id
     */

    private Integer id;

    /**
     * X
     */
    private Integer x;

    /**
     * Y
     */
    private Integer y;

    /**
     * Direction
     */
    private String direction;

    /**
     * Region id
     */
    private Integer regionId;

    /**
     * Update time
     */
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getX() {
        return x;
    }

    public void setX(Integer x) {
        this.x = x;
    }

    public Integer getY() {
        return y;
    }

    public void setY(Integer y) {
        this.y = y;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public Integer getRegionId() {
        return regionId;
    }

    public void setRegionId(Integer regionId) {
        this.regionId = regionId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (obj instanceof ReferencePoint){
            ReferencePoint referencePoint = (ReferencePoint) obj;
            return referencePoint.getId() == this.getId();
        }
        return false;
    }

    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getId();
        result = 31 * result + this.getX();
        result = 31 * result + this.getY();
        result = 31 * result + (this.getDirection() == null ? 0 : this.getDirection().hashCode());
        result = 31 * result + this.getRegionId();
        return result;
    }
}
